'''
自动管理cookie：
1.requests.get、requests.gpost 这种方式不会管理cookie
2.session 的机制，创建一个session
'''
import requests



s = requests.Session()#创建一个session
print("登录前：",s.cookies)
url = "https://www.bagevent.com/user/login"

cs = {"access_type":"1",
"loginType":"1",
"emailLoginWay":"0",
"account":"2780487875@qq.com",
"password":"qq2780487875",
"remindmeBox":"on",
"remindme":"1"}
r = s.post(url,data=cs)
# print(r.text)
print("=================登录后========================")
print("登录前：",s.cookies)

url = "https://www.bagevent.com/account/dashboard"
r = s.get(url)
# print(r.text)

url = "https://www.bagevent.com/user/login_out"
r = s.get(url)
# print(r.text)
print("退出登录后：",s.cookies)